package com.itbaiyun.usercenter.service;

import com.itbaiyun.usercenter.common.BaseResponse;
import com.itbaiyun.usercenter.model.domain.Team;
import com.baomidou.mybatisplus.extension.service.IService;
import com.itbaiyun.usercenter.model.domain.User;
import com.itbaiyun.usercenter.model.dto.TeamJoinDTO;
import com.itbaiyun.usercenter.model.dto.TeamQueryDTO;
import com.itbaiyun.usercenter.model.dto.TeamQuitDTO;
import com.itbaiyun.usercenter.model.dto.TeamUpdateDTO;
import com.itbaiyun.usercenter.model.vo.TeamUserVO;

import java.util.List;

/**
* @author O
* @description 针对表【team(队伍)】的数据库操作Service
* @createDate 2024-08-04 19:09:12
*/
public interface TeamService extends IService<Team> {

    /**
     *  创建队伍接口
     * @param team 队伍
     * @return
     */
    long addTeam(Team team, User loginUser);


    /**
     *  查询队伍
     * @param teamQueryDTO 查询要求
     * @param isAdmin 是否为管理员
     * @return 返回查询结果
     */
    List<TeamUserVO> listTeams(TeamQueryDTO teamQueryDTO,boolean isAdmin);

    /**
     *  更新队伍接口
     * @param teamUpdateDTO 要更新的内容
     * @return
     */
    boolean updateTeam(TeamUpdateDTO teamUpdateDTO,User loginUser);

    /**
     * 加入队伍接口
     * @param teamJoinDTO
     * @param loginUser
     * @return
     */
    boolean joinTeam(TeamJoinDTO teamJoinDTO,User loginUser);

    /**
     * 退出队伍接口
     * @param teamQuiteDTO
     * @param loginUser
     * @return
     */
    boolean quitTeam(TeamQuitDTO teamQuiteDTO,User loginUser);

    /**
     *  删除队伍接口
     * @param teamQuiteDTO
     * @param loginUser
     * @return
     */
    boolean deleteTeamByCaptain(TeamQuitDTO teamQuiteDTO,User loginUser);
}
